Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Select): add OnOpenChange options #1917

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

angryermine
Copy link

No description provided.

@korvin89
Copy link
Contributor

korvin89 commented Oct 25, 2024

@angryermine Hi! Why didn't the option onOpenChange work for you?

I think I've figured out what you need. Do you want to close the selector when selecting an option in multiple mode?

@angryermine
Copy link
Author

@angryermine Hi! Why didn't the option onOpenChange work for you?

onOpenChange triggers after popup closing, in my case a want to leave popup open

@korvin89
Copy link
Contributor

@angryermine Hi! Why didn't the option onOpenChange work for you?

onOpenChange triggers after popup closing, in my case a want to leave popup open

@angryermine Yep, I got it. I've edited my message

@angryermine
Copy link
Author

I think I've figured out what you need. Do you want to close the selector when selecting an option in multiple mode?

yep

@korvin89
Copy link
Contributor

I think I've figured out what you need. Do you want to close the selector when selecting an option in multiple mode?

yep

@angryermine Got it. You can handle open property by yourself in this case. I suppose it could help to get what you need

@angryermine
Copy link
Author

@angryermine Got it. You can handle open property by yourself in this case. I suppose it could help to get what you need

@korvin89

this results in a blink behaviour in a single selection mode

i have two cases:

  1. don't close popup in single selection
  2. close popup in multiple selection

it's the same as in Select2 (https://select2.org/dropdown#forcing-the-dropdown-to-remain-open-after-selection)

@korvin89
Copy link
Contributor

@angryermine I'll try to write some demo code in sandbox a little bit later

@korvin89
Copy link
Contributor

  1. don't close popup in single selection
  2. close popup in multiple selection

@angryermine About your cases:

  1. This case will be completed after this modification
  2. This case could be completed in this way

Would it work for you?

PS: you can add the second argument in this PR

@angryermine
Copy link
Author

@korvin89

Would it work for you?

looks like what i've been looking for

PS: you can add the second argument in this PR

done, but i'm not sure about default value

@angryermine angryermine changed the title feat(Select): add closeOnSelect property feat(Select): add OnOpenChange options Oct 26, 2024
@korvin89
Copy link
Contributor

@korvin89

Would it work for you?

looks like what i've been looking for

PS: you can add the second argument in this PR

done, but i'm not sure about default value

@angryermine What about default value?

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

@angryermine
Copy link
Author

@angryermine What about default value?

it's not obvious to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants